<?php echo $this->fetch('header.html'); ?>
<div class="row"> 
<div class="span12">
<?php echo $this->fetch('options/nav.html'); ?>
<?php if ($this->_var['parent']): ?>
<a href="<?php echo $this->_var['appadmin']; ?>?m=options&pid=<?php echo $this->_var['parent']['pid']; ?>&tablename=<?php echo $this->_var['tablename']; ?>" class="btn"><<<?php echo $this->_var['parent']['title']; ?></a>
<div class="clerfix"><br /></div>
<?php endif; ?>
<div class="search-form">
<form method="get" action="<?php echo $this->_var['appadmin']; ?>">
<input type="hidden" name="m" value="options" />
	类型：<select name="tablename">
    	<option value="0">请选择</option>
    	<?php $_from = $this->_var['table_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
        <option value="<?php echo $this->_var['k']; ?>" <?php if ($this->_var['k'] == $this->_var['tablename']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']; ?></option>
        <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
    <input type="submit" class="btn btn-success" value="选择" />
</form>
</div>
 <table class='table table-bordered' width='100%'>
  <tr>
   <td>id</td>
   <td>主题</td>
   <td>上级</td>
   <td>类型</td>
 
   <td>状态</td>
   <td>时间</td>
<td>操作</td>
  </tr>
 <?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
<tr>
   <td><?php echo $this->_var['c']['id']; ?></td>
   <td><?php echo $this->_var['c']['title']; ?></td>
   <td><?php echo $this->_var['c']['pid']; ?></td>
   <td><?php echo $this->_var['table_list'][$this->_var['c'][tablename]]; ?></td>
    
   <td><?php echo $this->_var['c']['status']; ?></td>
   <td><?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></td>
<td>
<a href="<?php echo $this->_var['appadmin']; ?>?m=options&a=addmore&pid=<?php echo $this->_var['c']['id']; ?>">添加子类</a>
<a href="<?php echo $this->_var['appadmin']; ?>?m=options&a=add&id=<?php echo $this->_var['c']['id']; ?>">编辑</a> <a href="<?php echo $this->_var['appadmin']; ?>?m=options&pid=<?php echo $this->_var['c']['id']; ?>">下级分类</a> <a href="javascript:;" class="delete" url="<?php echo $this->_var['appadmin']; ?>?m=options&a=delete&id=<?php echo $this->_var['c']['id']; ?>">删除</a></td>
  </tr>
   <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 </table>
<div><?php echo $this->_var['pagelist']; ?></div>
</div>
</div>
<?php echo $this->fetch('footer.html'); ?>